#ifndef POPUP_MAIN_DIALOG_H
#define POPUP_MAIN_DIALOG_H

#include <QDialog>
#include <QtGui>
#include <QSettings>

#include <PopupSettings.hpp>
#include <PopupProgressWidget.hpp>
#include <PopupNotificationFrame.hpp>
#include <PopupUsersManager.hpp>

#include <ui_setupdialog.h>

class PopupSetupDialog : public QDialog, private Ui_MainDialog
{
  Q_OBJECT

public:
  PopupSetupDialog(QWidget *parent = 0);
  virtual ~PopupSetupDialog() {}

signals:
  void signal_applyNewSettings();

private slots:
  void slot_applySettings();
  void slot_setDefaultStyleSheets();
  void slot_browseFile();
  void slot_browseCustomFontColor();
  void slot_updateCustomFontTestArea();
  void slot_saveCustomButton();
  void slot_cancelEditionOfCustomButton();
  void slot_deleteCurrentlySelectedCustomButton();
  void slot_editCurrentlySelectedCustomButton();
  void slot_customButtonNameChanged(const QString &);

protected:
  // Overrides
  virtual void showEvent(QShowEvent*);
  virtual void hideEvent(QHideEvent*);

private:

  typedef enum  {
    CBTN_STATE_INIT,
    CBTN_STATE_NEW_BUTTON,
    CBTN_STATE_EDIT_BUTTON
  } CustomButtonState;

  void initSettingsTab();
  QString getCustomFontCurrentColor();
  void enablecustomButtonsControls(CustomButtonState p_state);

  PopupSettings* m_settings;
  QPoint         m_lastPosition;
};

#endif
